const mongoose = require('mongoose');

// 酒店订单数据模型
const myOrderSchema = mongoose.Schema({
	// 酒店的id
	hotelId: {
		type: String,
		require: true,
		ref: 'hotel',
	},
	// 用户的id
	userId: {
		type: String,
		require: true,
		ref: 'user',
	},
	// 酒店总价价格
	totalPrice: {
		type: Number,
		require: true,
	},
	// 入住人
	nike_name:{
		type: String,
		require: true,
	},
	// 入住人电话
	tel:{
		type: String,
		require: true,
	},
	// 入住时间
	startdate:{
		type: String,
		require: true,
	},
	// 共几晚
	datelength:{
		type: String,
		require: true,
	},
	// 离店时间
	enddate:{
		type: String,
		require: true,
	},
	// 订单状态
	orederstate: {
		type: Number,
		require: true,
	},
	// 共几人
	peopleNum:{
		type: String,
		require: true,
	},

	//订单时间
	orderTime: {
		type: String,
		require: true,
	},
});

const myOrder = mongoose.model('myOrder', myOrderSchema);

module.exports = myOrder;
